package _05_stack;

import java.util.StringJoiner;

/**
 * @author: mornd
 * @dateTime: 2023/6/6 - 16:47
 */
public abstract class AbstractStack<E> implements Stack<E> {
    @Override
    public String toString() {
        StringJoiner joiner = new StringJoiner(",", "[", "]");
        for (E e : this) {
            joiner.add(String.valueOf(e));
        }
        return joiner.toString();
    }
}
